package cn.kailangtu.dataspot.data.status;

import org.greenrobot.eventbus.EventBus;

import cn.kailangtu.commonevents.eventEntity.BluetoothConnectChangedEvent;
import cn.kailangtu.commonevents.eventEntity.EthernetConnectChangedEvent;
import cn.kailangtu.commonevents.eventEntity.MobileConnectChangedEvent;
import cn.kailangtu.commonevents.eventEntity.UsbConnectChangedEvent;
import cn.kailangtu.commonevents.eventEntity.WifiConnectChangedEvent;
import cn.kailangtu.commontools.ConnectUtils;

public class ConnectStatus {
    private static boolean usbConnected = false;
    private static boolean wifiConnected = false;
    private static boolean bluetoothConnected = false;
    private static boolean mobileConnected = false;
    private static boolean ethernetConnected = false;



    public static boolean isUsbConnected() {
        return usbConnected;
    }

    public static void setUsbConnected(boolean usbConnected) {

            ConnectStatus.usbConnected = usbConnected;
            EventBus.getDefault().post(new UsbConnectChangedEvent());

    }

    public static boolean isWifiConnected() {
        return wifiConnected;
    }

    public static void setWifiConnected(boolean wifiConnected) {


            ConnectStatus.wifiConnected = wifiConnected;
            EventBus.getDefault().post(new WifiConnectChangedEvent());

    }

    public static boolean isBluetoothConnected() {
        return bluetoothConnected;
    }

    public static void setBluetoothConnected(boolean bluetoothConnected) {

            ConnectStatus.bluetoothConnected = bluetoothConnected;
            EventBus.getDefault().post(new BluetoothConnectChangedEvent());

    }

    public static boolean isMobileConnected() {
        return mobileConnected;
    }

    public static void setMobileConnected(boolean mobileConnected) {

            ConnectStatus.mobileConnected = mobileConnected;
           EventBus.getDefault().post(new MobileConnectChangedEvent());

    }

    public static boolean isEthernetConnected() {
        return ethernetConnected;
    }

    public static void setEthernetConnected(boolean ethernetConnected) {


            ConnectStatus.ethernetConnected = ethernetConnected;
            EventBus.getDefault().post(new EthernetConnectChangedEvent());

    }
}
